package com.jiyun.controller;

import com.jiyun.pojo.User;
import com.jiyun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@RequestMapping("/login")
@Controller
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/dl")
    public String login(User user){
     User user1  = userService.getUser(user);
        System.out.println(user1);
     if (user1==null){
         System.out.println("错了");
         return "redirect:/login.jsp";
     }else {
         System.out.println("没错");
//         session.setAttribute("");
         return "redirect:/st/list";
     }
    }
}
